package cn.bupt.edu.xianyu.dao;

import cn.bupt.edu.xianyu.entity.Xianyu;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.sql.SQLException;
import java.time.DayOfWeek;
import java.util.List;

public interface XianyuRepository extends JpaRepository<Xianyu,Long> {
    Page<Xianyu> findByUsername(String username, Pageable pageable);

    List<Xianyu> findByUsername(String username);

//    public default List<Xianyu> getProductName(String productName) {
//        List<Xianyu> list = null;
//        String sql = "select * from content where productName like ?";
//        try {
//            DayOfWeek runner;
//            list = (List<Xianyu>) runner.query(sql, new BeanListHandler(Xianyu.class), "%" + productName + "%");
//        } catch (SQLException e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
//        return list;
//
////    List<Xianyu> findByTypeid(Integer typeid);
////    List<Xianyu> findByTypeid(String typeid);
////    Page<Xianyu> findByType(String type);
//    }
}
